package com.example.demo.mysql;

import com.example.demo.config.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lzz
 * @package com.example.demo.mysql
 * @create 2019-05-20 17:21
 * @description: ${DESCRIPTION}
 */
@RestController
public class Rdis {
    @Autowired
    RedisUtil redisUtil;

    @RequestMapping("/redis")
    public String string(String key,String name ){

        return  redisUtil.set(key,name)+"";
    }

    @RequestMapping("/getredis")
    public String string(String key){

        return (String) redisUtil.get(key);
    }

}
